// user.js
import request from "@/utils/request";

// 获取全部用户信息
export function getUserList(params) {
  return request({
    url: "/employees/selectAllByEmpNameAndPhoneNumber",
    method: "get",
    params
  });
}

// 新增用户
export function addUser(data) {
  return request({
    url: "/employees/insertInto",
    method: "post",
    data
  });
}

// 修改用户
export function updateUser(data) {
  return request({
    url: "/employees/updateEmployee",
    method: "post",
    data
  });
}

// 通过用户id获取用户信息
export function getUserById(params) {
  return request({
    url: `/employees/selectAllByEmployeeId`,
    method: "get",
    params
  });
}

// 删除用户
export function deleteUserById(params) {
  return request({
    url: `/employees/deleteByEmployeeId`,
    method: "get",
    params
  });
}